<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>首页</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css">
</head>

<body class="bg-light">

    <div class="modal">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content   <%= code ? 'bg-success' : 'bg-danger text-white' %> ">
                <div class="modal-header">
                    <h5 class="modal-title"><%=title%></h5>
                </div>
                <div class="modal-body text-center p-5">
                    <%=message%>
                </div>
                <div class="modal-footer justify-content-center">
                    <a href="<%=url%>" class="<%= code ? 'text-dark' : 'text-white' %>  "><span id='time'>3</span>秒后跳转</a>
                </div>
            </div>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js"></script>
    <script>
        $('.modal').modal('show')

        let time = 3
        setInterval(() => {
            if (time == 0) {
                location.href='<%=url%>'
            }
            time--
            $('#time').text(time)
        }, 1000);
    </script>
</body>

</html>